﻿<%@ Page Language="C#" MasterPageFile="~/Header.Master" culture="auto" UICulture="auto" AutoEventWireup="true" CodeBehind="Messages.aspx.cs" Inherits="geekmeet.Messages" %>

<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js" type="text/javascript"></script>
    <script src="../Scripts/geekmeet.js" type="text/javascript"></script>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
    </asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="mainWrapper">
       <asp:SiteMapPath ID="SiteMapPath1" runat="server" CssClass="breadcrumbs">
        </asp:SiteMapPath>
    <asp:HiddenField ID="hiddenUserID" runat="server" ClientIDMode="Predictable" value=""/>
    <h1>Mina meddelanden</h1>

    <asp:MultiView ID="multiViewPageContent" runat="server">
        <asp:View ID="viewUpgrade" runat="server">
                <div id="messagesUpgradeMessage">
                    <h2 class="headerBanner">Skaffa Premium</h2>
                    <p>Vänligen uppgradera till Premium<br /> för att se dina privata meddelanden.</p>
                        <div class="button" onclick="location.href = 'Settings.aspx';">Uppgradera nu!</div>
                    
                    
                </div>
        </asp:View>

        <asp:View ID="viewPremium" runat="server">
        
   <div id="messagesTop">
                    <div id="MessagesNew">

                    <div class="button" onclick="newMessage()"><a href="#" onclick="newMessage()">Nytt meddelande</a></div>
                </div>

                 <div id="pageNotificationMessage">
                    
                                </div>
                </div>
   
   
    <div id="newMessageDialog" title="Nytt meddelande">
        <table style="width: 100%;">
            <tr>
                <td>
                    Mottagare (användarnamn)
                </td>
                <td>
                    <asp:TextBox name="messagestxtRecipient" ID="messagestxtRecipient" runat="server" 
                        ClientIDMode="Predictable" MaxLength="30"></asp:TextBox>
                    <%--<input type="text" id="messages-txtRecipient" name="messages-txtRecipient" />--%>
                    <asp:RequiredFieldValidator
                        ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" 
                        ControlToValidate="messagestxtRecipient" ForeColor="Red"></asp:RequiredFieldValidator>
                    <img src="" id="messages-foundUserStatus" class="foundUserStatusHidden"/>
                </td>
               
            </tr>
            <tr>
                <td>
                    Meddelande
                </td>
                <td>
                    <asp:TextBox name="messagestxtMessage" ID="messagestxtMessage" runat="server" Height="128px" Rows="5" 
                        TextMode="MultiLine" Width="330px" MaxLength="255"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ErrorMessage="*" ControlToValidate="messagestxtMessage" ForeColor="Red"></asp:RequiredFieldValidator>
                </td>
               
            </tr>
            <tr>
            <td></td>
                <td>
                <asp:Button ID="btnSendMessage" runat="server" Text="Skicka" onclick="btnSendMessage_Click" 
                        Enabled="False" />
                </td>
            </tr>
        </table>

        
    </div>
   <div id="messagesColumnsWrapper">
   
   <div id="messagesLeftContainer">

        <asp:Repeater ID="ContactRepeater" runat="server" ClientIDMode="Predictable">
        
            <ItemTemplate>
            <div class="messagesContact" id="contact_<%#DataBinder.Eval(Container.DataItem, "UserID") %>"
            onclick="showConversation('<%#DataBinder.Eval(Container.DataItem, "UserID") %>')">
            <img src="/images/profilePictures/<%#DataBinder.Eval(Container.DataItem, "UserID") %>.jpg" class="messagesContactImageSmall"/>
                <div class="messagesUsernameWrapper">
                  <%#DataBinder.Eval(Container.DataItem, "UserName") %>
                </div>
            
            </div>
            </ItemTemplate>
        
        </asp:Repeater>
  </div>
  
  <div id="messagesRightContainer">
                
    <div id="messagesWrapper">
      <asp:Repeater ID="messageRepeater" runat="server">
          <ItemTemplate>
           <div class="<%# ( (Eval("FromID").ToString()) == (loggedInUserGUID.ToString()) ? "messagePostFromMe":"messagePost") %>">
                      
                      <table style="width:100%;">
                        <tr>
                            <td width="60" rowspan="2" style="vertical-align:top">
                                 <img src="/images/profilePictures/<%#DataBinder.Eval(Container.DataItem, "FromID") %>.jpg"
                                class="messagesContactImageSmall" />
                            </td>
                            <td>
                                <div class="wallPostHeader">
                                <%#DataBinder.Eval(Container.DataItem, "FromUserName")%>&nbsp;
                                <span class="smallDate"><%#Eval("PostDate","{0:yyyy-MM-dd HH:mm}")%></span>
                                </div>
                                 <br />
                                 <div class="wallMessage">
                                 <%#Eval("MessageText")%>
                            </div>
                        </div>
                            </td>
                            
                           
                        </tr>
                       
                       
                    </table>
     
                       
                    </div>


          </ItemTemplate>
      </asp:Repeater>
      </div> <!-- messagesWrapper -->
     
      <asp:Panel ID="panSendQuickMessage" runat="server" Visible="False">
      
    <div id="conversationSendMessage">
        <h3><asp:Label ID="lblNewMessage" runat="server" Text="Nytt meddelande"></asp:Label></h3>
        <asp:TextBox ID="txtMessage" runat="server" Height="125px" Rows="10" 
            TextMode="MultiLine" Width="418px" MaxLength="255"></asp:TextBox><br />
        <asp:Button ID="btnQuickSend" runat="server" Text="Skicka" 
            onclick="btnQuickSend_Click" CausesValidation="False" /></div>
  </asp:Panel>
  </div>
     
         </asp:View>

    </asp:MultiView>

  </div>
 
 
</asp:Content>

